package com.xiaoyuan.aop;

import java.lang.reflect.Method;

import com.xiaoyuan.minicore.aop.DefaultHandler;
import com.xiaoyuan.minicore.aop.annotation.Aspect;
import com.xiaoyuan.minicore.aop.annotation.PointCut;

/**
 * @Auther: xiaoyuan
 * @Date: 2020/4/29
 * @Description: 自定义拦截器
 */
@Aspect(pkg = "com.xiaoyuan.service")
public class FirstCustomizeActionHandler extends DefaultHandler {


    @Override
    public void before(Method method, Object[] args) {
        System.out.println(method+"   my first customize handler");
    }

    @Override
    public boolean filter(Method method, Object[] args) {
        if(method.isAnnotationPresent(PointCut.class)){
            return true;
        }
        return false;
    }


}
